#include "EpilBlockStatementCode.h"
#include "EpilOutputHelper.h"
#include "TCharSupport.h"
#include "EpilPointerHelper.h"


EpilBlockStatementCode::EpilBlockStatementCode( const EpilLexLocation & location )
: EpilStatementCodeBase( location )
, m_chunk( NULL )
{
}


EpilBlockStatementCode::~EpilBlockStatementCode()
{
	EpilPointerHelper::SafeDelete( m_chunk );
}


tstring EpilBlockStatementCode::ToEpilCode( int indent ) const
{
	tstringstream ret;

	ret << EpilOutputHelper::GetIndent( indent );
	ret << t("do");
	ret << endl;

	ret << m_chunk->ToEpilCode( indent + 1 );

	ret << endl;
	ret << EpilOutputHelper::GetIndent( indent );
	ret << t("end");

	return ret.str();
}
